// types
import { createSlice } from '@reduxjs/toolkit';

// initial state
const initialState = {
  drawerOpen: false,
};

// ==============================|| SLICE - MENU ||============================== //

const menuStore = createSlice({
  name: 'menu',
  initialState,
  reducers: {
    initMenuState(state, action) {
      Object.assign(state, action.payload);
    },
    openDrawer(state, action) {
      state.drawerOpen = action.payload.drawerOpen;
    },
  },
});

export default menuStore;

export const { openDrawer } = menuStore.actions;
